// Copyright 2018-2020 Polyaxon, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * Polyaxon SDKs and REST API specification.
 * Polyaxon SDKs and REST API specification.
 *
 * The version of the OpenAPI document: 1.2.1-rc1
 * Contact: contact@polyaxon.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */


import ApiClient from "../ApiClient";
import RuntimeError from '../model/RuntimeError';
import V1ListBookmarksResponse from '../model/V1ListBookmarksResponse';
import V1ListProjectsResponse from '../model/V1ListProjectsResponse';
import V1Project from '../model/V1Project';
import V1ProjectSettings from '../model/V1ProjectSettings';
import V1ProjectTeams from '../model/V1ProjectTeams';

/**
* ProjectsV1 service.
* @module api/ProjectsV1Api
* @version 1.2.1-rc1
*/
export default class ProjectsV1Api {

    /**
    * Constructs a new ProjectsV1Api. 
    * Polyaxon sdk
    * @alias module:api/ProjectsV1Api
    * @class
    * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
    * default to {@link module:ApiClient#instance} if unspecified.
    */
    constructor(apiClient) {
        this.apiClient = apiClient || ApiClient.instance;
    }


    /**
     * Callback function to receive the result of the archiveProject operation.
     * @callback module:api/ProjectsV1Api~archiveProjectCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Archive project
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~archiveProjectCallback} callback The callback function, accepting three arguments: error, data, response
     */
    archiveProject(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling archiveProject");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling archiveProject");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/archive', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the bookmarkProject operation.
     * @callback module:api/ProjectsV1Api~bookmarkProjectCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Bookmark project
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~bookmarkProjectCallback} callback The callback function, accepting three arguments: error, data, response
     */
    bookmarkProject(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling bookmarkProject");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling bookmarkProject");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/bookmark', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the createProject operation.
     * @callback module:api/ProjectsV1Api~createProjectCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Project} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Create new project
     * @param {String} owner Owner of the namespace
     * @param {module:model/V1Project} body Project body
     * @param {module:api/ProjectsV1Api~createProjectCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Project}
     */
    createProject(owner, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling createProject");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling createProject");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1Project;
      return this.apiClient.callApi(
        '/api/v1/{owner}/projects/create', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the deleteProject operation.
     * @callback module:api/ProjectsV1Api~deleteProjectCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Delete project
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~deleteProjectCallback} callback The callback function, accepting three arguments: error, data, response
     */
    deleteProject(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling deleteProject");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling deleteProject");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the disableProjectCI operation.
     * @callback module:api/ProjectsV1Api~disableProjectCICallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Disbale project CI
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~disableProjectCICallback} callback The callback function, accepting three arguments: error, data, response
     */
    disableProjectCI(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling disableProjectCI");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling disableProjectCI");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/ci', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the enableProjectCI operation.
     * @callback module:api/ProjectsV1Api~enableProjectCICallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Enable project CI
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~enableProjectCICallback} callback The callback function, accepting three arguments: error, data, response
     */
    enableProjectCI(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling enableProjectCI");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling enableProjectCI");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/ci', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the fetchProjectTeams operation.
     * @callback module:api/ProjectsV1Api~fetchProjectTeamsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ProjectTeams} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get project teams
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~fetchProjectTeamsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ProjectTeams}
     */
    fetchProjectTeams(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling fetchProjectTeams");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling fetchProjectTeams");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ProjectTeams;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/teams', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getProject operation.
     * @callback module:api/ProjectsV1Api~getProjectCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Project} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get project
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~getProjectCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Project}
     */
    getProject(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getProject");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling getProject");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1Project;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getProjectSettings operation.
     * @callback module:api/ProjectsV1Api~getProjectSettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ProjectSettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get Project settings
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~getProjectSettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ProjectSettings}
     */
    getProjectSettings(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getProjectSettings");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling getProjectSettings");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ProjectSettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/settings', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listArchivedProjects operation.
     * @callback module:api/ProjectsV1Api~listArchivedProjectsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListProjectsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List archived projects for user
     * @param {String} user User
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search search.
     * @param {module:api/ProjectsV1Api~listArchivedProjectsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListProjectsResponse}
     */
    listArchivedProjects(user, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'user' is set
      if (user === undefined || user === null) {
        throw new Error("Missing the required parameter 'user' when calling listArchivedProjects");
      }

      let pathParams = {
        'user': user
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListProjectsResponse;
      return this.apiClient.callApi(
        '/api/v1/archives/{user}/projects', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listBookmarkedProjects operation.
     * @callback module:api/ProjectsV1Api~listBookmarkedProjectsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListBookmarksResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List bookmarked projects for user
     * @param {String} user User
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search search.
     * @param {module:api/ProjectsV1Api~listBookmarkedProjectsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListBookmarksResponse}
     */
    listBookmarkedProjects(user, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'user' is set
      if (user === undefined || user === null) {
        throw new Error("Missing the required parameter 'user' when calling listBookmarkedProjects");
      }

      let pathParams = {
        'user': user
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListBookmarksResponse;
      return this.apiClient.callApi(
        '/api/v1/bookmarks/{user}/projects', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listProjectNames operation.
     * @callback module:api/ProjectsV1Api~listProjectNamesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListProjectsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List project names
     * @param {String} owner Owner of the namespace
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search search.
     * @param {module:api/ProjectsV1Api~listProjectNamesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListProjectsResponse}
     */
    listProjectNames(owner, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listProjectNames");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListProjectsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/projects/names', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listProjects operation.
     * @callback module:api/ProjectsV1Api~listProjectsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListProjectsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List projects
     * @param {String} owner Owner of the namespace
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search search.
     * @param {module:api/ProjectsV1Api~listProjectsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListProjectsResponse}
     */
    listProjects(owner, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listProjects");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListProjectsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/projects/list', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchProject operation.
     * @callback module:api/ProjectsV1Api~patchProjectCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Project} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch project
     * @param {String} owner Owner of the namespace
     * @param {String} project_name Required name
     * @param {module:model/V1Project} body Project body
     * @param {module:api/ProjectsV1Api~patchProjectCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Project}
     */
    patchProject(owner, project_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchProject");
      }
      // verify the required parameter 'project_name' is set
      if (project_name === undefined || project_name === null) {
        throw new Error("Missing the required parameter 'project_name' when calling patchProject");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchProject");
      }

      let pathParams = {
        'owner': owner,
        'project.name': project_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1Project;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project.name}', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchProjectSettings operation.
     * @callback module:api/ProjectsV1Api~patchProjectSettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ProjectSettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch project settings
     * @param {String} owner Owner of the namespace
     * @param {String} project Project name
     * @param {module:model/V1ProjectSettings} body Project settings body
     * @param {module:api/ProjectsV1Api~patchProjectSettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ProjectSettings}
     */
    patchProjectSettings(owner, project, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchProjectSettings");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling patchProjectSettings");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchProjectSettings");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ProjectSettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/settings', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchProjectTeams operation.
     * @callback module:api/ProjectsV1Api~patchProjectTeamsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ProjectTeams} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch project teams
     * @param {String} owner Owner of the namespace
     * @param {String} project Project name
     * @param {module:model/V1ProjectTeams} body Project settings body
     * @param {module:api/ProjectsV1Api~patchProjectTeamsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ProjectTeams}
     */
    patchProjectTeams(owner, project, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchProjectTeams");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling patchProjectTeams");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchProjectTeams");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ProjectTeams;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/teams', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the restoreProject operation.
     * @callback module:api/ProjectsV1Api~restoreProjectCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Restore project
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~restoreProjectCallback} callback The callback function, accepting three arguments: error, data, response
     */
    restoreProject(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling restoreProject");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling restoreProject");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/restore', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the unbookmarkProject operation.
     * @callback module:api/ProjectsV1Api~unbookmarkProjectCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Unbookmark project
     * @param {String} owner Owner of the namespace
     * @param {String} project Project under namesapce
     * @param {module:api/ProjectsV1Api~unbookmarkProjectCallback} callback The callback function, accepting three arguments: error, data, response
     */
    unbookmarkProject(owner, project, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling unbookmarkProject");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling unbookmarkProject");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/unbookmark', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateProject operation.
     * @callback module:api/ProjectsV1Api~updateProjectCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Project} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update project
     * @param {String} owner Owner of the namespace
     * @param {String} project_name Required name
     * @param {module:model/V1Project} body Project body
     * @param {module:api/ProjectsV1Api~updateProjectCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Project}
     */
    updateProject(owner, project_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateProject");
      }
      // verify the required parameter 'project_name' is set
      if (project_name === undefined || project_name === null) {
        throw new Error("Missing the required parameter 'project_name' when calling updateProject");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateProject");
      }

      let pathParams = {
        'owner': owner,
        'project.name': project_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1Project;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project.name}', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateProjectSettings operation.
     * @callback module:api/ProjectsV1Api~updateProjectSettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ProjectSettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update project settings
     * @param {String} owner Owner of the namespace
     * @param {String} project Project name
     * @param {module:model/V1ProjectSettings} body Project settings body
     * @param {module:api/ProjectsV1Api~updateProjectSettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ProjectSettings}
     */
    updateProjectSettings(owner, project, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateProjectSettings");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling updateProjectSettings");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateProjectSettings");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ProjectSettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/settings', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateProjectTeams operation.
     * @callback module:api/ProjectsV1Api~updateProjectTeamsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ProjectTeams} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update project teams
     * @param {String} owner Owner of the namespace
     * @param {String} project Project name
     * @param {module:model/V1ProjectTeams} body Project settings body
     * @param {module:api/ProjectsV1Api~updateProjectTeamsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ProjectTeams}
     */
    updateProjectTeams(owner, project, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateProjectTeams");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling updateProjectTeams");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateProjectTeams");
      }

      let pathParams = {
        'owner': owner,
        'project': project
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ProjectTeams;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/teams', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the uploadProjectArtifact operation.
     * @callback module:api/ProjectsV1Api~uploadProjectArtifactCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Upload artifact to a store via project access
     * @param {String} owner Owner of the namespace
     * @param {String} project Project having access to the store
     * @param {String} uuid Unique integer identifier of the entity
     * @param {File} uploadfile The file to upload.
     * @param {Object} opts Optional parameters
     * @param {String} opts.path File path query params.
     * @param {Boolean} opts.overwrite File path query params.
     * @param {module:api/ProjectsV1Api~uploadProjectArtifactCallback} callback The callback function, accepting three arguments: error, data, response
     */
    uploadProjectArtifact(owner, project, uuid, uploadfile, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling uploadProjectArtifact");
      }
      // verify the required parameter 'project' is set
      if (project === undefined || project === null) {
        throw new Error("Missing the required parameter 'project' when calling uploadProjectArtifact");
      }
      // verify the required parameter 'uuid' is set
      if (uuid === undefined || uuid === null) {
        throw new Error("Missing the required parameter 'uuid' when calling uploadProjectArtifact");
      }
      // verify the required parameter 'uploadfile' is set
      if (uploadfile === undefined || uploadfile === null) {
        throw new Error("Missing the required parameter 'uploadfile' when calling uploadProjectArtifact");
      }

      let pathParams = {
        'owner': owner,
        'project': project,
        'uuid': uuid
      };
      let queryParams = {
        'path': opts['path'],
        'overwrite': opts['overwrite']
      };
      let headerParams = {
      };
      let formParams = {
        'uploadfile': uploadfile
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['multipart/form-data'];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/{project}/artifacts/{uuid}/upload', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }


}
